using System.IO;
using System.Collections.Generic;
using com.tc.assistance.utils;
namespace com.tc.config
{

    public class WorkingConfig
    {
        static public bool simulator = false;
        static public bool mainController = true;
        static WorkingConfig instance = new WorkingConfig();
        static public WorkingConfig getInstance()
        {
            return instance;
        }

        public bool validProxy()
        {

            return serverIp != null && port != 0;
        }
        public bool validMainController()
        {

            return port != 0;
        }

        string serverIp;
        public string getServerIp()
        {
            return serverIp;
        }
        public void setServerIp(string serverIp)
        {
            this.serverIp = serverIp;
        }
        public short getPort()
        {
            return port;
        }
        public void setPort(short port)
        {
            this.port = port;
        }
        short port;
        bool remote = true;
        public bool isRemote()
        {
            return remote;
        }
        public void setRemote(bool remote)
        {
            this.remote = remote;
        }
        public void save()
        {



        }
        public void load()
        {
            IDictionary<string, string> p = Utils.ReadDictionaryFile("config/proxy.properties");


            serverIp = p["ip"];
            port = short.Parse(p["port"].Trim());


        }
    }
}
